<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //构造函数名字 单词的首字符均为大写
    function CreateMovie(movieName,type,rate,showTime){
        this.movieName=movieName;
        this.type=type;
        this.showTime=showTime;
        this.rate=rate;
        this.getNextShowing=function(){
            var current=11;
            for(var i=0;i<this.showTime.length;i++){
                var timer=parseInt(this.showTime[i]);
                if(current<timer){
                    console.log(this.movieName+"下一次播放时间"+this.showTime[i]);
                    break;
                }
            }
        }
    }
    //对象实例化过程 使用关键字new
    var movie1=new CreateMovie("007","谍战类","3.0",["12.00","15:00","18:00"]);
    var movie2=new CreateMovie("指环王","，冒险类","4.0",["12.00","15:00","18:00"]);
    movie1.getNextShowing();
    console.log(movie1);
    console.log(movie2);
</script>
</html>